package com.sdy.web;

import com.alibaba.fastjson.JSONObject;
import com.sdy.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("product")
public class ProductController {

    @Autowired
    ProductService productService;

    @ResponseBody
    @RequestMapping("getOne")
    public JSONObject getProduct(){

        JSONObject jsonObject = new JSONObject();

        jsonObject.put("data",productService.getAbstractOne(1));
        jsonObject.put("data1",productService.getConcreteOne(2,4));

        return jsonObject;
    }
}
